import ctypes
if ctypes.windll.kernel32.GetConsoleWindow() !=0:
    ctypes.windll.user32.ShowWindow(ctypes.windll.kernel32.GetConsoleWindow(),0)
    ctypes.windll.kernel32.CloseHandle(ctypes.windll.kernel32.GetConsoleWindow(),0)

import time
import re
import os, sys

def def_frpc():
    
    try:
        os.system(r"start /d D:\ProF\frp_0.33.0_windows_amd64 /b frpc.exe -c D:\ProF\frp_0.33.0_windows_amd64\frpc.ini")
    except:
        pass
    try:
        os.system(r"start /d D:\ProF\frp_0.33.0_windows_amd64 /b frpc.exe -c D:\ProF\frp_0.33.0_windows_amd64\frpc_02.ini")
    except:
        pass
    try:
        os.system(r"start /d D:\ProF\frp_0.33.0_windows_amd64 /b frpc.exe -c D:\ProF\frp_0.33.0_windows_amd64\frpc_03.ini")
    except:
        pass
    
def_frpc()
time.sleep(10)
while True:
    if os.popen("tasklist").read().count("frpc.exe")<3:
        def_frpc()

    time.sleep(60)
